package encome.work.dao;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Message {
    @TableId
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    @TableField(value = "`time`",fill = FieldFill.INSERT)
    private Date time;
    @TableField(value = "`from`")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long from;
    @TableField(value = "`to`")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long to;
    @JsonSerialize(using = ToStringSerializer.class)
    private String content;
    @TableField(value = "`type`")
    private int type;
    @TableField(value = "`status`")
    private int status;

}
